package loop;

/**
 * @author:WIN10
 * @date:2022/1/15
 * @describe:如何声明一个数组
 */
public class DeclareArray {

    public static void main(String[] args) {
        //声明一个int类型的数组
        int[] scores = {70, 90, 80, 100};
        int[] intScore = new int[4];
        double[] doubles = new double[4];
        boolean[] booleans = new boolean[4];
        String[] strings = new String[4];
        for (int i = 0; i < intScore.length; i++) {
            System.out.println(intScore[i]);
        }
        for (int i = 0; i < doubles.length; i++) {
            System.out.println(doubles[i]);
        }
        for (int i = 0; i < scores.length; i++) {
            System.out.println(scores[i]);
        }
        for (int i = 0; i < booleans.length; i++) {
            System.out.println(booleans[i]);
        }
        for (int i = 0; i < strings.length; i++) {
            System.out.println(strings[i]);
        }
    }
}
